#ifndef HJ212_PACKET_H__
#define HJ212_PACKET_H__

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "list.h"
#include "enprodev.h"


#ifdef __cplusplus
extern "C" {
#endif


typedef struct _tag_hj212_packet_node_t 
{
    struct list_head list;
    char* str;
    int len;
} HJ212PakNode;

typedef void* HJPFPData;
typedef struct _tag_hj212_packet_t
{
    struct list_head head;
    HJPFPData prdata;
    void (*init_ppmsg)(HJPFPData* msg, char* pw, char* mn);
    void (*from_envpro_socket)(struct _tag_hj212_packet_t* fact, EnvProDev* epd);
    void (*destroy_list)(struct _tag_hj212_packet_t* fact);
    void (*begin)(struct _tag_hj212_packet_t* fact);
    int (*is_end)(struct _tag_hj212_packet_t* fact);
    void (*next)(struct _tag_hj212_packet_t* fact);
    HJ212PakNode* (*current)(struct _tag_hj212_packet_t* fact);
    void (*print)(struct _tag_hj212_packet_t* fact);
} HJ212PackFact;


HJ212PackFact* hj212_pack_fact_new(void);

HJ212PackFact* hj212_pack_fact_destroy(HJ212PackFact* fact);



#ifdef __cplusplus
}
#endif

#endif  // HJ212_MESSAGE_H__